<template>
	<view class="">
		<view class="sub-yue">
			<view class="sub-yue-top u-flex">
				<text>{{ titleName }}</text>
				<view class="right-icon">
					<u-icon @click="closeSubYue" name="close" color="#333333" size="18"></u-icon>
				</view>
			</view>
			<view class="scan-area u-flex">
				<input v-model="scanCode" type="text" placeholder="长按粘贴或输入抖音/美团/点评券码">
				<u-icon @click="scanRes" class="scan-icon" name="scan" color="#333333" size="26"></u-icon>
			</view>
			<view class="check-area u-flex">
				<u-checkbox-group v-model="checked">
					<u-checkbox :checked="checked.length===1" shape="circle" activeColor="#FF7814" size="16"></u-checkbox>
				</u-checkbox-group>
				<view class="text-check">
					开台视为同意<text>《用户协议》</text>	及<text>《隐私政策》</text>
				</view>
			</view>

			<view class="sub-date-btm u-flex">
				<view class="sub-yue-btn" @click="toPlaying">
					确定
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:['notifyId'],
		data() {
			return {
				showSubYue:false, //开台弹窗
				checked:[''],
				ticketVal:'暂无可用',
				scanCode:'', //卷码
        titleName:''
			}
		},
		onLoad(option) {
		},
		mounted() {
			this.selTypeId=this.notifyId;
      if(this.notifyId === "MEITUAN_PAY"){
        this.titleName = '美团点评券核销'
      } else if(this.notifyId === "DOUYIN_PAY"){
        this.titleName = '抖音券核销'
      }
			console.log(this.notifyId,'this.notifyId;')
		},
		methods:{
			//关闭开台
			closeSubYue(){
				this.$emit('closeSubYue')
			},
			//扫码
			scanRes(){
				let that=this
				// 允许从相机和相册扫码
				uni.scanCode({
					success: function (res) {
						that.scanCode=res.result
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
					}
				});
			},
			toPlaying(){
				console.log(1111)
				uni.navigateTo({
					url:"/page_subscribe/openSucess/openSucess"
				})
				this.closeSubYue()
			}

		}
	}
</script>

<style lang="scss" scoped>
	.sub-yue{
		padding: 20rpx 0 0 0;
		background-color: #ffffff;
		.sub-yue-top{
			padding: 0 26rpx;
			justify-content: center;
			position: relative;
			.right-icon{
				position: absolute;
				right: 26rpx;
			}
		}
		.scan-area{
			width: 687rpx;
			height: 96rpx;
			background: #EDEDED;
			border-radius: 8rpx;
			padding: 0 24rpx;
			box-sizing: border-box;
			margin: 20rpx auto;
			justify-content: space-between;
			input{
				width: 580rpx;
				font-size: 28rpx;
				color: #333333;
			}
			.uni-input-placeholder{
				color: #999999;
			}
		}
		.sub-date-btm{

			.sub-yue-btn{
				width: 686rpx;
				height: 72rpx;
				opacity: 0.5;
				border-radius: 36px;
				line-height: 72rpx;
				background: #FF7814;
				border-radius: 36rpx;
				font-size: 32rpx;
				font-weight: bold;
				color: #FFFFFF;
				text-align: center;
				margin: 0 auto 16rpx;
			}

		}
		.check-area{
			margin: 10rpx 26rpx 28rpx;
			.text-check{
				font-size: 24rpx;
				color: #999999;
				text{
					color: #263BDF;
				}
			}
		}

	}

</style>
